// 封装Banner轮播图相关的业务代码

// 封装banner轮播图相关的业务代码
import { ref, onMounted } from 'vue'
import { getBannerAPI } from '@/apis/home'

export function useBanner() {
    // 获取Banner
    // 响应式数据 data
    const bannerList = ref([]);
    // 定义方法执行
    const getBanner = async () => {
        const res = await getBannerAPI({
            distributionSite: "2"
        });
        console.log("op", res);
        bannerList.value = res.data.result;
    };
    onMounted(() => {
        getBanner();
    })
    return {
        bannerList
    }
}